package action;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.fileupload.FileUpload;
import org.apache.commons.lang.time.DateUtils;
import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class test extends ActionSupport {

	private String name;
	
	private File file1;

	public File getFile() {
		return file1;
	}

	public void setFile(File file1) {
		this.file1 = file1;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	private List<User> list;

	public List<User> getList() {
		return list;
	}

	public void setList(List<User> list) {
		this.list = list;
	}

	public String add() {
//		// 临时目录
//		String temp = ServletActionContext.getServletContext().getRealPath("/")
//				+ "temp";
//		System.out.println("temp=" + temp);
//		String loadpath = ServletActionContext.getServletContext().getRealPath(
//				"/")
//				+ "Image";
//		// 上传文件存放目录
//		System.out.println("loadpath=" + loadpath);
//
//		FileUpload fu = new FileUpload();
//
//		fu.setFileSizeMax(4 * 1024);
//		fu.setSizeMax(1 * 1024 * 1024); // 设置最多只允许在内存中存储的数据,单位:字节
//		fu.setHeaderEncoding("utf-8"); // 设置一旦文件大小超过getSizeThreshold()的值时数据存放在硬盘的目录
//		int index = 0;
//		List fileitem=null;
//		
		System.out.println(file1==null);
		
		return SUCCESS;

	}
}
